<template>
  <div>
    <div class="header">
      <h1>门店申请</h1>
    </div>
    <div class="content">
      <div class="content-left">
        <p>请输入店铺名称:</p>
        <p>店铺描述:</p>
      </div>
      <!-- 输入框区域 -->
      <div class="content-right">
        <el-input placeholder v-model="userInputOne" clearable></el-input>
        <el-form ref="form" label-width="120px">
          <el-input type="textarea" v-model="userInputTwo"></el-input>
        </el-form>
      </div>
    </div>
    <!-- 确认按钮 -->
    <div class="content-btn">
      <el-row>
        <el-button type="primary" @click="clearBtn">确认</el-button>
      </el-row>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      userInputOne: "",
      userInputTwo: "",
      newDate:''
    };
  },
  components: {},
  created() {},
  mounted() {
  
  },
  methods: {
    // 新增店铺
    clearBtn() {
        this.getDate()
        axios.post('/shop/Add',{params:{shopName:this.userInputOne,describe:this.userInputTwo,appDate:this.newDate}})
        .then(res=>{
          console.log(res.data)
       })
    },
    // 获取当前时间
    getDate() {
      const nowDate = new Date();
      const date = {
        year: nowDate.getFullYear(),
        month: nowDate.getMonth() + 1,
        date: nowDate.getDate()
      };
      const systemDate = date.year + "-" + 0 + date.month + "-" +  date.date;
      this.newDate = systemDate;
    }
  }
};
</script>
<style lang='less' scoped>
@import "../../assets/less/storeAdd.less";
</style>
